Skip to content

Conversation

@odolbeau
Copy link
Member

No description provided.

path: Twig/TranslationExtension.php

-
message: "#^Call to method getValue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\DataCollector\\\\Data\\.$#"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will become useless once missing use will be added in symfony
See: symfony/symfony#35122

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPStan will also give an error when a message is not used anymore 👍 Great way of gradually improving code quality

compliments to @ondrejmirtes 👏

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 😊

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

/** @var \Symfony\Component\HttpKernel\DataCollector\RequestDataCollector */
$requestCollector = $this->profiler->loadProfile($token)->getCollector('request');

$message
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about reducing fluent usage? That way you don't need to rely on the message returning itself.

$message->setLocale()
$message->setTranslation()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the original syntax.

- { name: 'data_collector', template: "@Translation/SymfonyProfiler/translation.html.twig", id: "translation", priority: 200 }

Translation\Bundle\Controller\SymfonyProfilerController:
autowire: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about moving this to a _defaults section?

_defaults:
    autowire: true
    autoconfigure: true

@odolbeau odolbeau merged commit 31c526c into php-translation:master Dec 29, 2019
@odolbeau odolbeau deleted the correct-controller branch December 29, 2019 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants